package com.b303.dataobject;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Order {
    private int id;
    private String userId;
    private String employeeId;
    private Timestamp datatime;
    private Timestamp predatatime;
    private int status;
    private String addr;
    private String note;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "employee_id")
    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }

    @Basic
    @Column(name = "datatime")
    public Timestamp getDatatime() {
        return datatime;
    }

    public void setDatatime(Timestamp datatime) {
        this.datatime = datatime;
    }

    @Basic
    @Column(name = "predatatime")
    public Timestamp getPredatatime() {
        return predatatime;
    }

    public void setPredatatime(Timestamp predatatime) {
        this.predatatime = predatatime;
    }

    @Basic
    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "addr")
    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    @Basic
    @Column(name = "note")
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return id == order.id &&
                status == order.status &&
                Objects.equals(userId, order.userId) &&
                Objects.equals(employeeId, order.employeeId) &&
                Objects.equals(datatime, order.datatime) &&
                Objects.equals(predatatime, order.predatatime) &&
                Objects.equals(addr, order.addr) &&
                Objects.equals(note, order.note);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, employeeId, datatime, predatatime, status, addr, note);
    }
}
